export default {
    set(key: string, value: any) {
        if (typeof value === "object") {
            value = JSON.stringify(value);
        }
        window.localStorage.setItem(key, value);
    },

    get(key: string) {
        let _value = window.localStorage.getItem(key);
        if (_value && _value?.startsWith("{") && _value?.endsWith("}")) {
            _value = JSON.parse(_value);
        }
        return _value;
    }
};
